Fix NativeAOT custom release configurations - #12451
Open
jonathanpeppers wants to merge 3 commits into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e48442c2-2acb-4228-9eec-4b7930738a0f
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new MSBuildDeviceIntegration device regression test intended to cover NativeAOT builds/publishes using a custom “release-like” configuration name (AppStore) and validate the produced APK can be installed and launched on-device, matching the scenario from #10851.
Changes:
- Adds
NativeAOTCustomReleaseConfigurationdevice test parameterized overdotnet buildvsdotnet publish. - Uses a custom release configuration name (
AppStore) while setting Release-like MSBuild properties (Optimize=true,DebugType=None). - Installs the produced signed APK via
adband asserts the activity launches.
Suppressed comments (1)
tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs:2786
adb installoutput commonly includes additional lines (e.g., "Performing Streamed Install") before "Success". UsingAssert.AreEqual("Success", ...)can make the test fail even when install succeeded; assert that the output contains "Success" instead.
Assert.AreEqual ("Success", RunAdbCommand ($"install -r \"{apk}\"").Trim (), "APK should install.");
Select NativeAOT for publish or optimized builds while keeping unoptimized Debug builds on CoreCLR. Resolve NativeAOT runtime-pack libraries by optimization flavor instead of the project configuration name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e48442c2-2acb-4228-9eec-4b7930738a0f
Disable the ILC publish-target import when PublishAot is used with a non-NativeAOT runtime, while preserving analyzer behavior. Ensure solution tests requesting NativeAOT actually build their Release configurations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e48442c2-2acb-4228-9eec-4b7930738a0f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NativeAOT runtime-pack libraries only have
debugandreleaseflavors, but the Android targets derived their names from$(Configuration). Custom release-like configurations such asAppStoretherefore tried to resolve nonexistent runtime libraries.This change:
PublishAot=true$(Optimize)instead of the configuration nameAppStoreconfiguration, including install and launch verificationFixes: #10851